package com.obas.model.type;

import java.util.ArrayList;
import java.util.List;

import com.ease.common.enums.EnumUtil;
import com.ease.common.enums.TextualEnum;

/**
 *
 * @author nathanleewei
 *
 */
public enum AnalogyDimensionType implements TextualEnum {

	USER("单用户", true), //
	USERAPP("单用户单应用能力", true), //
	USERSVC("单用户单业务能力", true), //
	BANDTAPP("单用户单应用能力", true), //BANDWIDTHAPP
	BANDTSVC("单用户单业务能力", true), //BANDWIDTHSVC
	APP("单应用能力", true), //
	SVC("单业务能力", true), //
	ROUTE("单用户路由能力", true), //
	SVLAN("网络BRAS节点单SVLAN能力", true), //
	PORT("网络BRAS节点单PORT能力", true), //
	DEVICE("网络节点能力", true), //
	DEVICEAPP("网络节点单应用能力", true), //
	DEVICESVC("网络节点单业务能力	", true), //
	DNSAPP("应用DNS服务器能力", false); //

	private String text;

	private Boolean enabled;

	private AnalogyDimensionType(String text, Boolean enabled) {
		this.text = text;
		this.enabled = enabled;
	}

	public static AnalogyDimensionType get(String name) {
		return EnumUtil.get(AnalogyDimensionType.class, name);
	}

	public static AnalogyDimensionType[] enabledValues() {
		List<AnalogyDimensionType> analogyDimensionTypes = new ArrayList<AnalogyDimensionType>();
		for (AnalogyDimensionType e : AnalogyDimensionType.class.getEnumConstants()) {
			if (true == e.getEnabled()) {
				analogyDimensionTypes.add(e);
			}
		}
		return analogyDimensionTypes.toArray(new AnalogyDimensionType[0]);
	}

	public String getText() {
		return text;
	}

	public String getName() {
		return name();
	}

	public String getTablePart() {
		return name();
	}

	/**
	 * @return the enabled
	 */
	public Boolean getEnabled() {
		return enabled;
	}

	public static void main(String[] args) {
		System.out.println("AnalogyDimensionType.enabledValues().length=" + AnalogyDimensionType.enabledValues().length);
	}
}
